package com.broadsoft.cluster.smartcluster.message;

import java.util.concurrent.Callable;

/**
 * Wrap runnable to carry forward the context information
 */
public class ExecutionContextAwareCallable implements Callable {
    private final Callable task;

    public ExecutionContextAwareCallable(Callable task) {
        this(task, false);
    }

    public ExecutionContextAwareCallable(Callable task, boolean useNewContext) {
        this.task = task;
    }

    public Object call() throws Exception {
        return task.call();
    }

}
